package com.facemox.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.facemox.bean.FaceExecuteLog;
import com.facemox.bean.ServerMonitor;
import com.facemox.bean.Statistic;
import com.facemox.mapper.StatisticMapper;
import com.facemox.service.StatisticService;

@Service
public class StatisticServiceImpl implements StatisticService {

    @Autowired
    private StatisticMapper statisticMapper;
    
    // 获取所有接口的总数目
    @Override
    public int getFaceCount() {
        int faceCount = statisticMapper.getFaceCount();
        return faceCount;
    }

    // 插入一条接口执行的统计数据
    @Override
    public int addFaceStatisticItem(Statistic statistic) {
        int effectLine = statisticMapper.addFaceStatisticItem(statistic);
        return effectLine;
    }

    // 获取接口执行次数
    @Override
    public int getFaceExecuteCount() {
        int faceExecuteCount = statisticMapper.getFaceExecuteCount();
        return faceExecuteCount;
    }

    // 添加一个服务监控
    @Override
    public int addServerMonitor(ServerMonitor serverMonitor) {
        int effectLine = statisticMapper.addServerMonitor(serverMonitor);
        return effectLine;
    }

    // 获取所有的服务监控
    @Override
    public List<ServerMonitor> getServerMonitor() {
        List<ServerMonitor> serverMonitor = statisticMapper.getServerMonitor();
        return serverMonitor;
    }

    // 获取服务监控数量
    @Override
    public int getServerMonitorCount() {
        int serverMonitorCount = statisticMapper.getServerMonitorCount();
        return serverMonitorCount;
    }

    // 记录接口执行日志
    @Override
    public int addFaceExecutelog(FaceExecuteLog faceExecuteLog) {
        int effectLine = statisticMapper.addFaceExecutelog(faceExecuteLog);
        return effectLine;
    }

    // 获取链路执行总数
    @Override
    public int getFaceLinkExecuteCount() {
        int faceLinkExecuteCount = statisticMapper.getFaceLinkExecuteCount();
        return faceLinkExecuteCount;
    }

    // 获取链路总数
    @Override
    public int getFaceLinkCount() {
        int faceLinkCount = statisticMapper.getFaceLinkCount();
        return faceLinkCount;
    }
    
}
